package ink.tiptop.service;

import ink.tiptop.persist.domain.entity.ZjfUserModuleVersionEntity;
import ink.tiptop.dto.req.version.AddZjfUserModuleVersionRequest;
import ink.tiptop.dto.req.version.DeleteZjfUserModuleVersionRequest;
import ink.tiptop.dto.req.version.QueryZjfUserModuleVersionRequest;
import ink.tiptop.dto.req.version.UpdateZjfUserModuleVersionRequest;
import ink.tiptop.common.domain.rsp.Response;

import java.util.List;

/**
 * 用于用户-模块版本的映射 
User:module = 1:n
(ZjfUserModuleVersionEntity)表服务接口
 *
 * @author makejava
 * @since 2020-06-21 20:39:19
 */
public interface ZjfUserModuleVersionService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    ZjfUserModuleVersionEntity queryById(Integer id);

    /**
     * 查询多条数据
     *
     * @return 对象列表
     */
    List<ZjfUserModuleVersionEntity> queryByUser(String user);

    /**
     * 新增数据
     *
     * @param zjfUserModuleVersionEntity 实例对象
     * @return 实例对象
     */
    ZjfUserModuleVersionEntity insert(ZjfUserModuleVersionEntity zjfUserModuleVersionEntity);

    /**
     * 修改数据
     *
     * @param zjfUserModuleVersion 实例对象
     * @return 实例对象
     */
    Response update(UpdateZjfUserModuleVersionRequest zjfUserModuleVersion);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);

    Response add(AddZjfUserModuleVersionRequest request);

    Response list(QueryZjfUserModuleVersionRequest request);

    Response deleteAll(DeleteZjfUserModuleVersionRequest request);

    void checkVersionExist(String user, String version);
}